package BOOKset;

import java.util.Iterator;
import java.util.Set;
import java.util.TreeSet;

public class TestTreeSet2 {

	public static void main(String[] args) {
		
		//用有序的	TreeSet储存学生对象
		Set stuTs=new TreeSet();
		stuTs.add(new Student("王云",1));
		stuTs.add(new Student("南天华",3));
		stuTs.add(new Student("刘景涛",2));
		stuTs.add(new Student("张平",3));
		//使用迭代器循环输出
		Iterator it =stuTs.iterator();
		while(it.hasNext()) {
			System.out.println(it.next());
		}

	}

}
